/* Announcment Bar Module */
/* A module displaying time senstive announcemnts */


/* VARIABLES */

$announcement-bar: '.announcement-bar';
$announcement-bar-height: 104px;
$announcement-bar-width: 784px;

/* CLASS */

#{$announcement-bar} {
  height: 104px;
  width: $announcement-bar-width;
  position: absolute;
  margin-left: auto;
  top: 500px;
  color: $darkgray;
  background: $white;
  border-radius: 4px;
  overflow: hidden;
  box-sizing: border-box;
  box-shadow: 0 4px 4px rgba(0,0,0,0.24), 0 0 4px rgba(0,0,0,0.12);

  @media (max-width: $announcement-bar-width) {
    height: auto;
    margin: 0;
    position: static;
    text-align: center;
    width: 100%;
  }
}

// SLIDES CONTAINER
#{$announcement-bar}-slides {
  position: relative;
  overflow: hidden;
  color: $darkgray;
  background: $white;
  height: $announcement-bar-height;
  width: $announcement-bar-width;
  box-sizing: border-box;
  box-shadow: 0 4px 4px rgba($black, 0.24), 0 0 4px rgba($black, 0.12);

  @media (max-width: 480px) {
    box-shadow: 0 2px 2px rgba($black, 0.24), 0 0 2px rgba($black, 0.12);
    height: 240px;
    margin: 0;
    padding: 32px 48px;
    text-align: center;
    width: auto;
  }
}

// INDIVIDUAL SLIDE
#{$announcement-bar}-slide {
  bottom: 0;
  box-sizing: border-box;
  height: $announcement-bar-height;
  left: 0;
  margin-bottom: -$announcement-bar-height;
  opacity: 0;
  padding: 32px;
  position: absolute;
  right: 0;
  transition: all .8s;
  width: $announcement-bar-width;
  z-index: 1;

  @media (max-width: 480px) {
    height: auto;
    margin: 0;
    padding:0;
    width: auto;
    transition: opacity .8s;
    visibility: hidden;
  }

  img, p {
    float: left;

    @media (max-width: 480px) {
      display: block;
      float: none;
    }
  }

  img {
    height: 40px;
    margin: 8px auto;
  }

  p {
    font-size: 18px;
    line-height: 40px;
    margin: 0;
    padding: 0;

    @media (max-width: 480px) {
      line-height: 24px;
      margin: auto;
    }

  }

  .button,
  .button.md-button {
    margin: 0;
    padding: 0 40px;
    background: $lightgray;
    color: $white;
    float: right;
    font-size: 14px;
    line-height: 40px;
    transition: all .3s ease-in-out;

    &:hover {
      background: $blue;
      box-shadow: 0 2px 2px rgba($black, 0.24), 0 0 2px rgba($black, 0.12);
      color: $white;
    }

    @media (max-width: $announcement-bar-width) {
      float: none;
      margin: 16px auto;
    }
  }

  &.is-visible  {
    margin-bottom: 0;
    opacity: 1;
    z-index: 2;

    @media (max-width: $announcement-bar-width) {
      position: static;
      visibility: visible;
      justify-content: center;
      display: flex !important;
      flex-direction: column;
      padding: 8px;
      height: auto;
      width: 100%;
      margin: 0;
    }

    @media (max-width: 480px) {
      padding: 16px;
    }
  }
}

// NAV BAR
#{$announcement-bar} nav {
  bottom: -40px;
  color: $lightgray;
  left: 0;
  position: absolute;
  right: 0;
  text-align: center;
  z-index: 1;

  button {
    background: $lightgray;
    border: none;
    border-radius: 100px;
    height: 12px;
    margin: 0 4px;
    outline: none;
    overflow: hidden;
    text-indent: -3000px;
    width: 12px;

    &.is-selected,
    &.selected  {
      background: $lightgray;
    }
  }
}